package cn.db101.view;

import javax.swing.*;
import javax.swing.border.EmptyBorder;
import java.awt.*;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;

public class admin_account_mainFrame {
	JFrame jf = new JFrame();
	private JPanel contentPane;

	/**
	 * Launch the application.
	 * public static void main(String[] args) {
		EventQueue.invokeLater(new Runnable() {
			public void run() {
				try {
					mainFrame frame = new mainFrame();
					frame.setVisible(true);
				} catch (Exception e) {
					e.printStackTrace();
				}
			}
		});
	}
	 */
	

	/**
	 * Create the frame.
	 */
	public  void init() {//��װ��ͼ
		jf.setTitle("管理员主界面");
		
		jf.setIconImage(Toolkit.getDefaultToolkit().getImage(admin_account_mainFrame.class.getResource("/icon/Libraries_64px_1176502_easyicon.net.png")));
		jf.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		jf.setBounds(100, 100, 1278, 805);
		
		JMenuBar menuBar = new JMenuBar();
		jf.setJMenuBar(menuBar);
		
		JMenu m1 = new JMenu("主界面");
		m1.setIcon(new ImageIcon(admin_account_mainFrame.class.getResource("/icon/线性图书.png")));
		menuBar.add(m1);
		
		JMenu m2 = new JMenu("图书管理规定");
		m2.setIcon(new ImageIcon(admin_account_mainFrame.class.getResource("/icon/线性老师.png")));
	
		
		menuBar.add(m2);
		
		JMenu m3 = new JMenu(" 图书查询");
		m3.setIcon(new ImageIcon(admin_account_mainFrame.class.getResource("/icon/线性本子vg.png")));
		menuBar.add(m3);
		
		JMenu m4 = new JMenu("图书借还");
		m4.setIcon(new ImageIcon(admin_account_mainFrame.class.getResource("/icon/线性铅笔.png")));
		menuBar.add(m4);
		
		JMenu m5 = new JMenu("账户管理");
		m5.setIcon(new ImageIcon(admin_account_mainFrame.class.getResource("/icon/线性双指点击.png")));
		menuBar.add(m5);
		
		JMenu m6 = new JMenu("图书管理");
		m6.setIcon(new ImageIcon(admin_account_mainFrame.class.getResource("/icon/线性文件管理员.png")));
		menuBar.add(m6);
		contentPane = new JPanel();
		contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
		contentPane.setLayout(new BorderLayout(0, 0));
		jf.setContentPane(contentPane);
		
		JLayeredPane layeredPane = new JLayeredPane();
		contentPane.add(layeredPane, BorderLayout.CENTER);
		
		JLayeredPane layeredPane_1 = new JLayeredPane();
		layeredPane_1.setBounds(534, 162, 450, 533);
		layeredPane.add(layeredPane_1);
		
		JLabel addbook_label = new JLabel("\u501F\u4E66\u8BB0\u5F55");
		addbook_label.addMouseListener(new MouseAdapter() {
			@Override
			public void mouseClicked(MouseEvent e) {
				new borrow_record_Frame().init();
			}
		});
		addbook_label.setIcon(new ImageIcon(admin_account_mainFrame.class.getResource("/icon/线性老师.png")));
		addbook_label.setForeground(Color.MAGENTA);
		addbook_label.setFont(new Font("微软雅黑", Font.PLAIN, 30));
		addbook_label.setBackground(Color.WHITE);
		addbook_label.setBounds(149, 148, 170, 43);
		layeredPane_1.add(addbook_label);
		
		JLabel addbook_label_1 = new JLabel("\u6DFB\u52A0\u6743\u9650");
		addbook_label_1.addMouseListener(new MouseAdapter() {
			@Override
			public void mouseClicked(MouseEvent e) {
				new add_limit_Frame().init();
			}
		});
		addbook_label_1.setIcon(new ImageIcon(admin_account_mainFrame.class.getResource("/icon/线性老师.png")));
		addbook_label_1.setForeground(new Color(255, 0, 255));
		addbook_label_1.setFont(new Font("微软雅黑", Font.PLAIN, 30));
		addbook_label_1.setBackground(Color.WHITE);
		addbook_label_1.setBounds(149, 219, 170, 43);
		layeredPane_1.add(addbook_label_1);
		
		JLabel addbook_label_3 = new JLabel("\u4FEE\u6539\u5BC6\u7801");
		addbook_label_3.addMouseListener(new MouseAdapter() {
			@Override
			public void mouseClicked(MouseEvent e) {
				new alter_password_Frame().init();
			}
		});
		addbook_label_3.setIcon(new ImageIcon(admin_account_mainFrame.class.getResource("/icon/线性老师.png")));
		addbook_label_3.setForeground(new Color(255, 0, 255));
		addbook_label_3.setFont(new Font("微软雅黑", Font.PLAIN, 30));
		addbook_label_3.setBackground(Color.WHITE);
		addbook_label_3.setBounds(149, 283, 170, 43);
		layeredPane_1.add(addbook_label_3);
		
		JLabel addbook_label_4 = new JLabel("\u4FEE\u6539\u8D26\u53F7");
		addbook_label_4.addMouseListener(new MouseAdapter() {
			@Override
			public void mouseClicked(MouseEvent e) {
				new alter_account_Frame().init();
			}
		});
		addbook_label_4.setIcon(new ImageIcon(admin_account_mainFrame.class.getResource("/icon/线性老师.png")));
		addbook_label_4.setForeground(Color.MAGENTA);
		addbook_label_4.setFont(new Font("微软雅黑", Font.PLAIN, 30));
		addbook_label_4.setBackground(Color.WHITE);
		addbook_label_4.setBounds(149, 73, 170, 43);
		layeredPane_1.add(addbook_label_4);
		
		JLabel addbook_label_5 = new JLabel("\u9000\u51FA\u767B\u5F55");
		addbook_label_5.addMouseListener(new MouseAdapter() {
			@Override
			public void mouseClicked(MouseEvent e) {
				int result=JOptionPane.showConfirmDialog(null, "�Ƿ��˳���¼");
				if(result==0) {
					closeThis();
					new mainFrame().init();
				}
			}
		});
		addbook_label_5.setIcon(new ImageIcon(admin_account_mainFrame.class.getResource("/icon/线性老师.png")));
		addbook_label_5.setForeground(Color.MAGENTA);
		addbook_label_5.setFont(new Font("微软雅黑", Font.PLAIN, 30));
		addbook_label_5.setBackground(Color.WHITE);
		addbook_label_5.setBounds(149, 347, 170, 43);
		layeredPane_1.add(addbook_label_5);
		
		JLabel label = new JLabel("");
		label.setIcon(new ImageIcon(admin_account_mainFrame.class.getResource("/img/account.png")));
		label.setBounds(0, 0, 1250, 722);
		layeredPane.add(label);
		
		m1.addMouseListener(new MouseAdapter() {
			@Override
			public void mouseClicked(MouseEvent e) {

				//���ٵ�ǰҳ��
				closeThis();
				//���´���
				new admin_mainFrame().init();
			}
		});	
		m2.addMouseListener(new MouseAdapter() {
			@Override
			public void mouseClicked(MouseEvent e) {

				//���ٵ�ǰҳ��
				closeThis();
				//���´���
				new admin_regulationFrame().init();
			}
		});	
		m3.addMouseListener(new MouseAdapter() {
			@Override
			public void mouseClicked(MouseEvent e) {

				//���ٵ�ǰҳ��
				closeThis();
				//���´���
				new admin_searchFrame().init();
			}
		});	
		m4.addMouseListener(new MouseAdapter() {
			@Override
			public void mouseClicked(MouseEvent e) {

				//���ٵ�ǰҳ��
				closeThis();
				//���´���
				new admin_borrow_mainFrame().init();
			}
		});	
		m6.addMouseListener(new MouseAdapter() {
			@Override
			public void mouseClicked(MouseEvent e) {

				//���ٵ�ǰҳ��
				closeThis();
				//���´���
				new bookmanage_mainFrame().init();
			}
		});	
		//���ô���ɼ�
		jf.setVisible(true);	
		//����JFrame������ʾ
		jf.setLocationRelativeTo(null);
	}
	
	public  void closeThis() {
		jf.dispose();
	}
	public static void main(String[] args) {//�ͻ������
		new admin_account_mainFrame().init();	
	}
}
